<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.7.14/dist/vue.js"></script>
</head>

<body>
    <div id="app">
        用户名：<input type="text" placeholder="用户名" v-model="test1">
        密码: <input type="password" v-model="password">
        <button @click='up'>提交</button>
        <button @click='reset'>重置</button>


    </div>
    <script>
        const app = new Vue({
            el: '#app',
            data: {
                test1: '',
                password: ''
            }, 
            methods: {
                up() {
                    console.log('hello'+this.test1);

                },
                reset() {
                    this.test1 = '',
                        this.password = ''
                }
            }
        });
    </script>
</body>

</html>